from django import template
from django.template.defaultfilters import stringfilter

register = template.Library()

@register.filter(name='mss')
def mss(length):
    seconds = length % 60
    minutes = int(length / 60)
    if seconds < 10:
        seconds = '0' + str(seconds)
    return str(minutes) + ':' + str(seconds)